package com.fyt.ZhongYaoApp.Controller;



import com.fyt.ZhongYaoApp.pojo.DoctorCat;
import com.fyt.ZhongYaoApp.pojo.DoctorCatDet;
import com.fyt.ZhongYaoApp.pojo.Hospital;
import com.fyt.ZhongYaoApp.pojo.Result;
import com.fyt.ZhongYaoApp.service.DoctorCatService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/doctorcat")
@Tag(name = "doctorCat",description = "the doctorCat API") // 接口大标题
public class DoctorCatController {

    @Autowired
    private DoctorCatService doctorCatService;

    @PostMapping("/add")
    public Result addDoctorCat(@RequestBody DoctorCat doctorCat) {
        doctorCatService.add(doctorCat);
        return Result.success("添加成功");
    }

    @GetMapping("/info")
    public Result<String> getDoctorCat(@RequestBody DoctorCat doctorCat) {

        return Result.success(doctorCatService.getDoctorCatById(doctorCat));
    }

    @PostMapping("/getDoctorCatDet")
    public Result<List<DoctorCatDet>> getDoctorCatDet(@RequestBody DoctorCat doctorCat) {

        return Result.success(doctorCatService.getDoctorCatDetByDCatId(doctorCat));
    }

}
